<!DOCTYPE html>
<html>
<head>
	<title>获取样式</title>
	<meta charset="utf-8">
	<style type="text/css">
	*{margin:0px;padding: 0px;}
	#div1{
		width:200px;
		height: 200px;
		background: red;
		border:1px solid #ccc;
		font-size:12px; 
		color: blue;
	}
	</style>

	<script type="text/javascript">
		window.onload=function(){
			startMove();
		}

		function startMove(){
			setInterval(function(){
				var oDiv=document.getElementById('div1');
				//alert(oDiv.offsetWidth);
				oDiv.style.width = parseInt(getStyle(oDiv,'width'))-1+'px';
				oDiv.style.fontSize = parseInt(getStyle(oDiv,'fontSize'))+1+'px';
			},30)
		}

		function getStyle(obj,attr){
			if (obj.currentStyle) {
				return obj.currentStyle[attr];//IE
			}else{
				return getComputedStyle(obj,false)[attr];//火狐
			}
		}
	</script>
</head>
<body>
<div id='div1'>font-size</div>
</body>
</html>